<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta name="viewport"
		content="width=device-width,user-scalable=no,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0">
	<title>疫情分析系统</title>
	<link rel="stylesheet" href="./res/layui/css/layui.css">
	<link rel="stylesheet" href="./res/static/css/index.css">
	<link rel="icon" href="./images/favicon.ico">
	<script src="./highCharts/art-template.js"></script>
	<script src="./api/config.js"></script>
	<script src="./highCharts/jquery-3.2.1.js"></script>
</head>

<body>

	<!-- nav部分 -->
	<div class="nav index">
		<div class="nav-logo">
			<a href="./status.html">
				<img src="./res/static/img/logo.png" width="65" style="margin-left: 20px;">
			</a>
		</div>

		<div class="layui-container">
			<div class="nav-list">
				<ul class="layui-nav" lay-filter="" style="margin: 0 -35px;">
					<li class="layui-nav-item"><a href="status.html">疫情现状</a></li>
					<li class="layui-nav-item"><a href="nat.html">核酸检测</a></li>
					<li class="layui-nav-item"><a href="news.html">疫情新闻</a></li>
					<li class="layui-nav-item"><a href="virus.html">专题展示</a></li>
					<li class="layui-nav-item"><a href="way.html">出行速查</a></li>
					<li class="layui-nav-item"><a href="resident.html">居民上报</a></li>
					<li class="layui-nav-item layui-this"><a href="hospital.html">医院速查</a></li>
				</ul>
			</div>
		</div>
	</div>

	<!-- main -->
	<div class="main-news">
		<div class="layui-container">
			<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
				<legend>医院查询</legend>
			</fieldset>

			<form class="layui-form layui-form-pane" action="" >
				<div class="layui-form-item" id="area-picker">
					<div class="layui-inline">
						<label class="layui-form-label">医院名字</label>
						<div class="layui-input-inline">
							<input type="text" name="hospital_name" id="hospital_name" autocomplete="off" class="layui-input">
						</div>
					</div>
					<div class="layui-inline">
						<label class="layui-form-label">医院地址</label>
						<div class="layui-input-inline">
							<input type="text" name="hospital_address" id="hospital_address" autocomplete="off" class="layui-input">
						</div>
					</div>

					<div class="layui-inline">
						<button type="submit" class="layui-btn layui-btn-primary" lay-submit
							lay-filter="data-search-btn"><i class="layui-icon"></i> 搜 索</button>
					</div>
				</div>
			</form>

			<div class="layui-form">
				<table class="layui-table" id="currentTableId" lay-filter="currentTableFilter"></table>
			</div>
		</div>
	</div>

	<!-- footer部分 -->
	<!-- <div class="footer">
			<div class="layui-container">
				<div class="layui-row footer-contact">
					<div class="layui-col-sm6 layui-col-md4 layui-col-lg3">
						<p class="contact-top"><span class="right">疫情信息管理系统 </span></p>
						<p class="contact-bottom"><span class="right"></span></p>
					</div>
				</div>
			</div>
		</div> -->

	<script src="./lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
	<script>
		      layui.use(['form', 'table', 'laydate'], function () {
            var $ = layui.jquery,
                form = layui.form,
                laydate = layui.laydate,
                table = layui.table;


			table.render({
				elem: '#currentTableId',
				url: 'http://localhost:8080/admin/hospital/hospital/queryAllHospital',
				defaultToolbar: ['filter', 'exports', 'print', {
					title: '提示',
					layEvent: 'LAYTABLE_TIPS',
					icon: 'layui-icon-tips'
				}],
				cols: [[
					{ field: 'hospital_name', title: '医院名字' },
					{ field: 'hospital_address', title: '医院地址' },
					{ field: 'hospital_level', title: '级别' },
					{ field: 'hospital_public', title: '是否公立'},

				]],

			});

			// 监听搜索操作
			form.on('submit(data-search-btn)', function (data) {
				var result = JSON.stringify(data.field);
				// layer.alert(result, {
				//     title: '最终的搜索信息'
				// });
					
				// alert(data.field.hospital_name);

				//执行搜索重载
				table.reload('currentTableId', {
					// page: {
					// 	curr: 1
					// }
					where: {
						hospital_name: data.field.hospital_name,
						hospital_address: data.field.hospital_address,
					}
				}, 'data');

				return false;
			});


		});
	</script>


</body>

</html>